<template>
  <div></div>
</template>

<script>
import { GetRequest } from "@/utils";
import { getToken, setToken, removeToken } from "@/utils/auth";

export default {
  data() {
    return {
      urlCode: {}
    };
  },
  created() {
    let code = GetRequest(window.location.href).code;
    this.urlCode = JSON.parse(decodeURIComponent(code));
    console.log("参数解码后", this.urlCode);
    if (this.urlCode.action == "setToken") {
      setToken(encodeURIComponent(this.urlCode.token));
      let testToken = getToken();
      console.log("参数为setToken，设置新token:", testToken);
      window.location.href = "http://localhost:9527";
      // console.log(process.env.VUE_APP_BASE_YMW);
    } else {
      removeToken();
      let testToken = getToken();
      console.log("参数为removeToken，清除token:", testToken);
    }
  },
  methods: {}
};
</script>

<style>
</style>